<?php
	$roomID = $_GET["roomName"];
	$ownerID = $_GET["androidID"];

	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$sql = "
	DELETE FROM OwnersOfRoom
	WHERE roomID = '$roomID' AND ownerID = '$ownerID';
	";
	
	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Error in changing the tempo ' . mysql_error());
	} 
	
	$sql = "
	DELETE FROM Rooms
	WHERE roomID = '$roomID';
	";
	
	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Error in deleting the room ' . mysql_error());
	} 
	
	$sql = "
	DELETE FROM StudentsInRooms
	WHERE roomID = '$roomID';
	";

	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Error in deleting in students in rooms' . mysql_error());
	} 
	
	mysql_close();
?>